Repository navigation
WordPress: 中断メッセージを stdout に出して出力順を揃える - #6
Merged
Merged
Conversation
before_sync は改行なし(echo -n)でログ出力中のため、中断メッセージを stderr に 出すと先に flush され、"- before_sync -> Processing..." より前に表示されて 出力順が入れ替わっていた。 実際のデプロイログで確認した挙動の修正。成功時のログと同じ stdout に揃える。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This was referenced Jul 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
#4 の中断を danc.kyushu-u.ac.jp の staging で実際に発火させたところ、出力順が入れ替わっていた。
deploy.shはecho -n "$log_label- before_sync -> Processing..."と改行なしでログを出したままbefore_syncを呼ぶ。中断メッセージを stderr に出していたため、バッファに残った stdout より先に flush され、順序が逆転していた。変更内容
中断メッセージを stdout に出すよう変更した(
cat >&2→cat)。成功時のログと同じ扱いになり、出力順が自然になる。GitHub Actions では stdout / stderr とも同じログに出力されるため、stderr にしておく実利はなく、順序の一貫性を優先した。
動作確認
bash -nで構文チェック済み